Debug a dll from java java->jni.dll ->app.dll -> app.dll?

But this is the same. I do the same, so let me explain my working set. I am using eclipse 3.1 and Visual C++ 2003 7.1.3088 (German... sorry ;) ) and Windows XP.

I load some_jni. Dll and some. Dll in java and using the jni classes.Some.

Dll loads internaly other.dll. I can debug some. Dll and other.

Dll in visual studio. Start your application and put a breakpoint to the first jni class call. Open VS and go to (in German) "Debuggen" (Debugging) -> "Prozesse" (Processes) Their you will see the javaw.

Exe Select the javaw. Exe and and press "Anfügen" (Attach). When I remeber, the code page in c++ wher the breakpoint is placed has to be open in VS.

VS will not open the page when the breakpoint is hit automaticaly. When the dll is loaded and the code line where you put a breakpoint is executed, the debugger in VS will stop at this position. Notice: this will only happen, when you compile the dll you want to debug in with debug options!

Otherwise the debugger will not stop at the C++ breakpoint. I did this half a year ago, but this should be the right steps.It hope you get it.

It's been a long while since I last did this, and even then it was on Linux & Solaris. An incomplete solution is to embed 'hard coded breakpoints' in your DLL with "_asm int 3;" Whenever Windows executes this instruction it gives the desktop user the chance to attach a suitably configured debugger to the afflicted process. It's not quite as smooth as pointing a debugger at a known process ID, but it should get you going.M.

In visual studio you can adapt the debugger to a running java process. When a breakpoint in the C++ code is hit, the debugger will show this in visual studio and will stop the process. At the moment I have no visual studio installed but in the debug options is a window where you can see all running processes.

Look for the java process and add the process to the debug session. When the dll execute the line in which the breakpoint is placed you will see it. EDIT: The dll you have to compile with debug informations and not in release mode, otherwise the debuger in visual studio will not stop at the breakpoint!

I can debug the jni dll with attach process in visual studio, but I want to be able to debug the dlls that the jni dll is communicating with.

As an alternative, try IKVM. ikvm.net.

One crude way of doing is create an infinite loop in the dll that you want to debug as: int x = 1; while(x); Once the Java application enters this loop attach to this process through a debugger and set the value of x to 0 to break the loop and now you can step through using the debugger.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions